<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="Admin/webroot/css/style.css"/>
<title>添加栏目</title>
</head>
<script type="text/javascript" src="Admin/webroot/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="Admin/webroot/js/global.js"></script>
<script type="text/javascript" src="Admin/webroot/js/input.js"></script>
<!--[if IE ]>
<style>.localUpload{ display:none}.msg-s .ke-inline-block{ display:block} </style>
<![endif]-->
<body>
<!--[if lte IE 6]>
<script src="js/DD_belatedPNG_0.0.8a.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
	DD_belatedPNG.fix('.pngfix');
</script>
<![endif]-->
<div class="rightbox">
    	<div class="rightbox-col" id="rightbox">
        	<div class="main">
                {include file='../Common/main_title.html'}
                <div class="bd">
                	<div class="height_20"></div>
                    <div class="menu-add">
                    	<div class="hd">
                        	<table>
                            	<tr>
                                	<td width="85px" style="padding-right:7px" align="right">打开方式：</td>
                                    <td width="434px">
                                    <a data-name='tab'  data-value="0"  {if $menu.is_extend_links}{if $menu.is_extend_links eq 0}class="tabBtn selectBtn focus"{else}class="tabBtn selectBtn"{/if}{else}class="tabBtn selectBtn focus"{/if} href="javascript:;"> 内链</a>
                                            <a data-name='tab' data-value="1"    {if $menu.is_extend_links}{if $menu.is_extend_links eq 1}class="tabBtn selectBtn focus"{else}class="tabBtn selectBtn"{/if}{else}class="tabBtn selectBtn"{/if}   href="javascript:;">外链</a>
                                            <input type="hidden" name="tab" id="menu_val" value="{if $menu.is_extend_links}{$menu.is_extend_links}{else}0{/if}"/>                                    	
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="bd">
                        	
							<table cellpadding="0" cellspacing="0" width="100%" border="0">
                                    <tr>
                                        <td width="85px" style="padding-right:7px" align="right">父级栏目：</td>
                                        <td width="434px">
                                        	<div class="s-select-c" style="z-index:999;">
                                        		<input disabled="disabled" type="text" autocomplete="off" name="parent_name" {if $menu.parent_name}value="{$menu.parent_name}"{else}value="请选择父级栏目"{/if} class="s-select"/>
                                                <div class="s-select-menu"  style="z-index:999">
                                                	<ul>
          {foreach from=$parent_list item=list}                                          	<li data-select="{$list.id}"><a href="#">{$list.name}</a></li>
                                                        {/foreach}                                                </ul>
                                                </div>
                                                <input type="hidden" class="fmenu" name="parent_id" value="{$menu.parent_id}" />
                                            </div>
                                            
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td width="85px" style="padding-right:7px" align="right"><span class="red">*</span>栏目标题：</td>
                                        <td width="434px">
                                        	<div class="s-select-c">
                                        		<input type="text" name="name" value="{$menu.name}"/>
                                                

                                            </div>
                                            
                                        </td>
                                        <td></td>
                                    </tr>
                                     {if $_CFG.DIGLOSSIA==1}
                                     <tr>
                                        <td width="85px" style="padding-right:7px" align="right"><span class="red">*</span>英文标题：</td>
                                        <td width="434px">
                                        	<div class="s-select-c">
                                        		<input type="text" name="en_name" value="{$menu.en_name}"/>
                                                

                                            </div>
                                            
                                        </td>
                                        <td></td>
                                    </tr>

                                     {/if}
                                    <tr>
                                        <td width="85px" style="padding-right:7px" align="right"><span class="red">*</span>栏目别名：</td>
                                        <td width="434px">
                                        	<div class="s-select-c">
                                        		<input type="text" name="code" value="{$menu.code}"/>
                                                

                                            </div>
                                            
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr id="tab0" {if $menu.is_extend_links}{if $menu.is_extend_links eq 0}style=""{else}style="display:none;"{/if}{else}style=""{/if}>
                                    <td colspan="3" style="padding-bottom: 0px;">
                                    <table>
                                    <tr>
                                        <td width="85px"  align="right"><span class="red">*</span>栏目类型：</td>
                                        <td width="434px">
                                        	<div class="s-select-c">
                                        		<input type="text" autocomplete="off" name="type_name" {if $menu.type_name }value="{$menu.type_name}"{else}value="请选择栏目类型"{/if} class="s-select"/>
                                                <div class="s-select-menu" id="s2">
                                                	<ul>
                                                    	<li data-select="1"><a href="#">文章模块</a></li>
                                                        <li data-select="2"><a href="#">相册模块</a></li>
                                                        <li data-select="3"><a href="#">图文模块</a></li>
                                                        <li data-select="4"><a href="#">产品模块</a></li>
                                                    </ul>
                                                </div>
                                                <input type="hidden" class="fmenu" name="type" value="{$menu.type}" />
                                            </div>
                                            
                                        </td>
                                        <td></td>
                                    </tr>
                                    
                                    <tr>
                                        <td width="85px" style="padding-right:7px" align="right">栏目关键词：</td>
                                        <td width="434px"><input type="text" name="keywords" value="{$menu.keywords}"/></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td width="85px" style="padding-right:7px" align="right">栏目摘要：</td>
                                        <td width="434px"><input type="text" name="description" value="{$menu.description}"/></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td width="85px" style="padding-right:7px" align="right">缩略图</td>
                                        <td width="434px"><input type="text" id="img_url" disabled="disabled" name="thumb_url" value="{$menu.thumb}" id="thumb"/>
                                       
                                        </td>
                                        <td>
                                        <div class="msg-s">
                                        	<a href="javascript:;"   class="localUpload" onclick="$(this).next().children('form').children('.ke-upload-file').click()">本地上传</a>
                    <input id="uploadButton_" return_url="img_url" type="button" value="submit" />
                                             {if $menu.thumb}
                                        <img style="position: absolute;
margin-top: 10px;" src="{$menu.thumb}" width="80px" />
                                        {/if}
                                         
                                           </div>
                                        </td>
                                    </tr>
                                    </table>
                                    </td>
                                    </tr>
                                    <tr id="tab1" {if $menu.is_extend_links eq 1}style=""{else} style="display:none"{/if}>
                                        <td width="85px" style="padding-right:7px" align="right">外链地址：</td>
                                        <td width="434px"><input type="text" name="redirect_url" {if $menu.redirect_url} value="{$menu.redirect_url}" {else} value="http://"{/if}/></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td width="85px" style="padding-right:7px" align="right">{$_L['IS_NAV']}：</td>
                                        <td width="434px">
											<div class="s-radio-x">
                                                <a href="javascript:;" data-checked="1" {if $menu.is_show eq 1}class="focus"{/if}></a> 是 &nbsp;&nbsp;&nbsp;&nbsp;
                                                <a href="javascript:;" {if $menu.is_show eq 0}class="focus"{/if} data-checked="0"></a> 否
                                                <input type="hidden" name="is_show" class="show" value="{$menu.is_show}"/>
                                            </div>
                                            
                                        </td>
                                        <td></td>
                                    </tr>
                                </table>
                                <div class="height_24"></div>
                                <div class="pro-add-sub-c">
                                <input type="hidden" name="id" class="show" value="{$menu.id}"/>
                                <input type="submit" class="pro-add-sub submit_btn"  value="保存"/></div>
                              
                        </div>
                        
                        
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
<script type="text/javascript" src="Admin/webroot/js/editor/kindeditor.js"></script>
<script type="text/javascript" src="Admin/webroot/js/kindeditor_upload.js"></script>
<script type="text/javascript">
    $(function(){
		hungry_uploadimg('index.php?g=admin&m=menu&a=file');
		$('.pro-add-sub').click(function(){
			var action = '{$action}';
			var cat_id=($('input[name=cat_id]').val());
			var id=($('input[name=id]').val());
			var name=($('input[name=name]').val());
			var en_name=($('input[name=en_name]').val());
			var description=($('input[name=description]').val());
			var keywords=($('input[name=keywords]').val());
			var is_extend_links=($('input[name=tab]').val());
			var parent_id=($('input[name=parent_id]').val());
			var code=($('input[name=code]').val());
			var type=($('input[name=type]').val());
			var is_show=($('input[name=is_show]').val());
		
			var redirect_url=($('input[name=redirect_url]').val());
			
			
			var thumb=($('input[name=thumb_url]').val());
			$.post('index.php?g=admin&m=menu&a='+action,{ id:id,cat_id:cat_id,name:name,is_extend_links:is_extend_links,description:description,keywords:keywords,parent_id:parent_id,redirect_url:redirect_url,code:code,type:type,is_show:is_show,thumb:thumb,en_name:en_name,type:type},function(result){
				//alert(result);
				
				showMsg(result.content,result.url);
			//window.history.go(0);
				},'json');
			})
		
		});
	
</script>

</body>
</html>
